﻿<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8"/>
    <script src="../jquery-1.7.2.min.js"></script>
    <script src="../eiap-all.js"></script>
    <title>构造Combox数据</title>
    <script type="text/javascript">
        EIAP.onReady(function () {
            EIAP.ComboBox({
                renderTo: "combobox1",
                title: "行号",
                labelWidth: 100,
                name: 'item',
                beforeSelect:function(){
                    console.log(arguments);
                },
                afterSelect:function(data){
                    console.log(data.data.item);
                },
               // field: ['value'],
                data: [{ item: 1}, { item: 2}]
            });
            EIAP.NumberField({
                renderTo: "numberfield1",
                title: "行号",
                labelWidth: 100,
                name: 'item',
                // field: ['value'],
                value:0
            });

            var dataTemp = {
                "BaseMoney_C19ECAB6-3D7A-637B-F095-0FDF3BE24585": "1000.00",
                "CanUseMoney_C19ECAB6-3D7A-637B-F095-0FDF3BE24585": "900.00",
                "ItemNumber_C19ECAB6-3D7A-637B-F095-0FDF3BE24585": "1",
                "Remark_C19ECAB6-3D7A-637B-F095-0FDF3BE24585": "cs",
                "TaxRate_C19ECAB6-3D7A-637B-F095-0FDF3BE24585": "14.00",
                "UseMoney_C19ECAB6-3D7A-637B-F095-0FDF3BE24585": "100.00"
            };

            //var item= {
            //    itemId: "",
            //    itemNumber: "",
            //    itemName:{}
            //}
            //for (var p in dataTemp) {
            //    var s = p.split("_");
            //    if (s[0]==="ItemNumber") {
            //        item.itemNumber = dataTemp[p];
            //        item.itemId = s[1];

            //    }
            //}

            var item = {
                "1": "1",
                itemName: [{ Id: "1", IsRecogonized: 1, DocName: 1 }, { Id: "2", IsRecogonized: 2, DocName: 2 }, { Id: "3", IsRecogonized: 3, DocName: 3 }]
            };
            delete item["2"];
            var de = "1";
            for (var i=0;i<item.itemName.length;i++) {
                if (de === item.itemName[i].Id) {
                    item.itemName.splice(i, 1);
                }
            }
            var s = 1;

        });
    </script>
</head>
<body>
    <div id="combobox1"></div>
    <div id="numberfield1"></div>
</body>
</html>